package com.lvmama.controller.rhino.log;

import com.github.pagehelper.PageInfo;
import com.lvmama.client.rhino.LogClient;
import com.lvmama.pojo.dto.rhino.log.LogConditionVO;
import com.lvmama.pojo.entity.rhino.log.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@RequestMapping("log")
@Controller
public class LogController {

	@Autowired
	private LogClient client;

	@RequestMapping(value = "list",method = {RequestMethod.POST,RequestMethod.GET})
	public String logList(LogConditionVO condition, Model model) {
		PageInfo<Log> page = client.findList(condition);
		model.addAttribute("page", page);
		model.addAttribute("logs", page.getList());
		model.addAttribute("condition", condition);
		return "system/logList";
	}
}
